package cn.tedu.submarine;

import javax.swing.ImageIcon;

/**
 * 水雷潜艇类
 */
public class MineSubmarine extends SeaObject{
    public MineSubmarine(){
        super(63,19);
    }
    @Override
    public void move() {
        //水雷潜艇向右移动
        setX(getX()+getSpeed());
    }

    @Override
    public ImageIcon getImage() {
        return Images.minesubm;
    }
    public Mine shootMine(){
        //x水雷潜艇的x坐标+水雷潜艇的宽（右边发射水雷）
        //y水雷潜艇的y坐标-水雷-水雷的y坐标
        return new Mine(this.getX()+this.getWidth(),this.getY()-11);
    }
}
